from PyQt6.QtWidgets import QGraphicsDropShadowEffect
from PyQt6.QtGui import QColor

def add_window_shadow(widget):
    """为窗口添加阴影效果"""
    shadow = QGraphicsDropShadowEffect(widget)
    shadow.setColor(QColor(0, 0, 0, 60))  # 阴影颜色和透明度
    shadow.setBlurRadius(20)              # 阴影模糊半径
    shadow.setXOffset(0)                  # 阴影X偏移
    shadow.setYOffset(0)                  # 阴影Y偏移
    widget.setGraphicsEffect(shadow) 